﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Data;
using BP.DA;
using BP.Sys;
using BP.Web;
using BP.Port;
using BP.En;
using BP.WF.Rpt;
using BP.Difference;
using BP.WF.Data;
using BP.WF.Admin;
using BP.WF.Template;
using BP.WF.HttpHandler;
using BP.WF;

namespace BP.CCFast
{
    /// <summary>
    /// 页面功能实体
    /// </summary>
    public class DataV_Home : DirectoryPageBase
    {
        /// <summary>
        /// 页面功能实体
        /// </summary>
        public DataV_Home()
        {

        }

        #region 管理员.
        public string Admin_GenerFlowInfo()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "待办";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=2");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-clock";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "退回";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=5");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "完成";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=3");
            dr["fontColor"] = "red";
            dr["icon"] = "icon-check";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "草稿";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=1");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-note";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "冻结";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=7");
            dr["fontColor"] = "#1890ff";
            dr["icon"] = "icon-bell";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "移交";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_GenerWorkFlow WHERE WFState=6");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-login";
            dt.Rows.Add(dr);
            return BP.Tools.Json.ToJson(dt);
        }
        public string Admin_TemplateInfo()
        {
            string orgExp = "";
            if (SystemConfig.CCBPMRunModel != CCBPMRunModel.Single)
                orgExp = " AND OrgNo='" + WebUser.OrgNo + "'";

            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "流程模板";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_Flow WHERE 1=1 " + orgExp);
            dr["fontColor"] = "black";
            dr["icon"] = "icon-clock";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "节点数";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM WF_Node WHERE 1=1");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "表单数";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM Sys_MapData WHERE 1=1  " + orgExp);
            dr["fontColor"] = "red";
            dr["icon"] = "icon-check";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "部门数";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM Port_Dept WHERE 1=1 " + orgExp);
            dr["fontColor"] = "black";
            dr["icon"] = "icon-note";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "人员数";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM Port_Emp WHERE 1=1 " + orgExp);
            dr["fontColor"] = "#1890ff";
            dr["icon"] = "icon-bell";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "岗位";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT count(*) as Num FROM Port_Station WHERE 1=1 " + orgExp);
            dr["fontColor"] = "black";
            dr["icon"] = "icon-login";
            dt.Rows.Add(dr);
            return BP.Tools.Json.ToJson(dt);
        }

        /// <summary>
        /// 部门流程发起分布
        /// </summary>
        /// <returns></returns>
        public string Admin_DeptStartFlows()
        {
            string orgExp = "";
            if (SystemConfig.CCBPMRunModel != CCBPMRunModel.Single)
                orgExp = " AND OrgNo='" + WebUser.OrgNo + "'";
            string sql = "SELECT DeptName, COUNT(*) AS Num  FROM WF_GenerWorkflow WHERE DeptName!='' " + orgExp + " GROUP BY DeptName";
            return DBAccess.RunSQLReturnTableJson(sql);
        }
        public string Admin_StartFlows()
        {
            string orgExp = "";
            if (SystemConfig.CCBPMRunModel != CCBPMRunModel.Single)
                orgExp = " AND OrgNo='" + WebUser.OrgNo + "'";
            string sql = "SELECT FlowName, COUNT(*) AS Num  FROM WF_GenerWorkflow  WHERE FlowName!='' " + orgExp + "GROUP BY FlowName";
            return DBAccess.RunSQLReturnTableJson(sql);
        }
        #endregion 管理员.

        /// <summary>
        /// 单据信息
        /// </summary>
        /// <returns></returns>
        public string EmpHome_MyBillInfo()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "单据待办";
            dr["exp"] = BP.CCBill.Dev2Interface.DB_Todolist();
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-clock";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "单据退回";
            dr["exp"] = BP.CCBill.Dev2Interface.DB_Todolist();
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "单据未完成";
            dr["exp"] = BP.CCBill.Dev2Interface.DB_Todolist();
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-minus";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "已完成";
            dr["exp"] = BP.CCBill.Dev2Interface.DB_Todolist();
            dr["fontColor"] = "red";
            dr["icon"] = "icon-notebook";
            dt.Rows.Add(dr);
            return BP.Tools.Json.ToJson(dt);


            //  children:
            //      [
            //  { title: '单据待办', exp: `SELECT count(*) as Num FROM Frm_GenerWorker WHERE EmpNo = '@WebUser.No' AND PassSta = 0`, fontColor: 'black', icon: 'icon-clock' },
            //  {
            //      title: '单据退回',
            //    exp: `SELECT count(*) as Num FROM Frm_GenerWorker WHERE EmpNo = '@WebUser.No' AND PassSta = 3  ${ this.orgExp} `,
            //    fontColor: 'red',
            //    icon: 'icon-action-undo',
            //  },
            //  {
            //      title: '单据未完成',
            //    exp: `SELECT count(*) as Num FROM Frm_GenerWorker WHERE EmpNo = '@WebUser.No' AND PassSta = 2 ${ this.orgExp} `,
            //    fontColor: 'red',
            //    icon: 'icon-minus',
            //  },
            //  {
            //      title: '单据已完成',
            //    exp: `SELECT count(*) as Num FROM Frm_GenerWorker WHERE EmpNo = '@WebUser.No' AND PassSta = 2  ${ this.orgExp} `,
            //    fontColor: 'yellow',
            //    icon: 'icon-notebook',
            //  },
            //],
        }
        /// <summary>
        /// 待办分布
        /// </summary>
        /// <returns></returns>
        public string EmpHome_TodolistByNodeName()
        {
            string sql = "SELECT NodeName, Count(*) as Num FROM WF_GenerWorkerList WHERE IsPass=0 AND FK_Emp='"+WebUser.No+"' group by NodeName";
            sql = BP.Difference.Glo.DealExp(sql, null);
            return DBAccess.RunSQLReturnTableJson(sql);
        }

        /// <summary>
        /// 我的发起数
        /// </summary>
        /// <returns></returns>
        public string EmpHome_MyStart()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "发起总数";
            dr["exp"] = Dev2Interface.MyStart_Runing;
            dr["fontColor"] = "black";
            dr["icon"] = "icon-paper-plane";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "已完成";
            dr["exp"] = Dev2Interface.Todolist_Complete;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "未完成";
            dr["exp"] = Dev2Interface.Todolist_Runing;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "按期完成";
            dr["exp"] = "0";
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "逾期完成";
            dr["exp"] = "0";
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "按期完成率";
            dr["exp"] = "0";
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "上月新增";
            dr["exp"] = Dev2Interface.LastMonthMyStart_Runing;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "本月新增";
            dr["exp"] = Dev2Interface.MonthMyStart_Runing;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "昨日新增";
            dr["exp"] = Dev2Interface.YesMyStart_Runing;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "今日新增";
            dr["exp"] = Dev2Interface.TodayMyStart_Runing;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);
            return Tools.Json.ToJson(dt);
        }

        /// <summary>
        /// 我的待办信息
        /// </summary>
        /// <returns></returns>
        public string EmpHome_MyTodolist()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "待办";
            dr["exp"] = Dev2Interface.Todolist_EmpWorks;
            dr["fontColor"] = "black";
            dr["icon"] = "icon-clock";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "退回";
            dr["exp"] = Dev2Interface.Todolist_ReturnNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);


            dr = dt.NewRow();
            dr["title"] = "挂起";
            dr["exp"] = Dev2Interface.Todolist_HungupNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "会签";
            dr["exp"] = Dev2Interface.Todolist_HuiQian;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);


            dr = dt.NewRow();
            dr["title"] = "未读";
            dr["exp"] = Dev2Interface.Todolist_UnRead;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "移交";
            dr["exp"] = Dev2Interface.Shiftlist_Num;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "抄送";
            dr["exp"] = Dev2Interface.CCList_UnRead;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "昨日新增";
            dr["exp"] = Dev2Interface.YesTodolist_Works;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "今日新增";
            dr["exp"] = Dev2Interface.TodayTodolist_Works;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);


            return Tools.Json.ToJson(dt);
        }
        /// <summary>
        /// 已完成
        /// </summary>
        /// <returns></returns>
        public string EmpHome_MyComplate()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "累计已完成";
            dr["exp"] = Dev2Interface.Todolist_Complete;
            dr["fontColor"] = "black";
            dr["icon"] = "icon-check";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "正常结束";
            dr["exp"] = Dev2Interface.Comlist_Complete;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "非正常结束";
            dr["exp"] = Dev2Interface.Overlist_Complete;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "按期完成";
            dr["exp"] = "0";
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "逾期完成";
            dr["exp"] = "0";
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "按期完成率";
            dr["exp"] = "0";
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "昨日新增";
            dr["exp"] = Dev2Interface.Yeslist_Complete;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "今日新增";
            dr["exp"] = Dev2Interface.Todaylist_Complete;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);
            return Tools.Json.ToJson(dt);
        }
        public string EmpHome_MyRuning()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "在途数";
            dr["exp"] = Dev2Interface.Todolist_Runing;
            dr["fontColor"] = "black";
            dr["icon"] = "icon-hourglass";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "退回中";
            dr["exp"] = Dev2Interface.Todolist_ReturnNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "移交中";
            dr["exp"] = Dev2Interface.Shiftlist_Num;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "逾期中";
            dr["exp"] = Dev2Interface.Todolist_OverWorkNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "挂起中";
            dr["exp"] = Dev2Interface.Todolist_HungupNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);
        
            return Tools.Json.ToJson(dt);
        }
         
        /// <summary>
        /// 统计
        /// </summary>
        /// <returns></returns>
        public string EmpHome_TongJi()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("title");
            dt.Columns.Add("exp");
            dt.Columns.Add("fontColor");
            dt.Columns.Add("icon");

            DataRow dr = dt.NewRow();
            dr["title"] = "发起数(累计)";
            dr["exp"] = DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS Num FROM WF_GenerWorkFlow WHERE Starter='" + WebUser.No + "' AND WFState >1 ");
            dr["fontColor"] = "black";
            dr["icon"] = "icon-clock";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "退回";
            dr["exp"] = Dev2Interface.Todolist_ReturnNum;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "未完成";
            dr["exp"] = Dev2Interface.Todolist_Runing;
            dr["fontColor"] = "red";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["title"] = "未读";
            dr["exp"] = Dev2Interface.Todolist_UnRead;
            dr["fontColor"] = "yellow";
            dr["icon"] = "icon-action-undo";
            dt.Rows.Add(dr);
            return Tools.Json.ToJson(dt);
        }

        #region 我的-流程动态组件.
        /// <summary>
        /// 自定义组件-流程动态
        /// 更多打开近期就好.
        /// </summary>
        /// <returns></returns>
        public string Self_MovementFlow_My()
        {
            string sql = "";
            switch (SystemConfig.AppCenterDBType)
            {
                case DBType.MySQL:
                case DBType.DM:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  LIMIT 20";
                    break;
                case DBType.MSSQL:
                    sql = "SELECT Top 20 SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1  AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  ";
                    break;
                case DBType.KingBaseR8:
                case DBType.KingBaseR6:
                case DBType.KingBaseR3:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  FETCH FIRST 20 ROWS ONLY ";
                    break;
                case DBType.Oracle:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 TodoEmps LIKE '%" + WebUser.No + ",%' AND  ROWNUM <= 20 ORDER BY SendDT DESC ";
                    break;
                default:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  LIMIT 20";
                    break;
            }
            DataTable dt = DBAccess.RunSQLReturnTable(sql);
            return Tools.Json.ToJson(dt);
        }
        /// <summary>
        /// 流程动态-更多
        /// </summary>
        /// <returns></returns>
        public string Self_MovementFlow_More()
        {
            string sql = "";
            switch (SystemConfig.AppCenterDBType)
            {
                case DBType.MySQL:
                case DBType.DM:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  LIMIT 20";
                    break;
                case DBType.MSSQL:
                    sql = "SELECT Top 20 SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1  AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  ";
                    break;
                case DBType.KingBaseR8:
                case DBType.KingBaseR6:
                case DBType.KingBaseR3:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  FETCH FIRST 20 ROWS ONLY ";
                    break;
                case DBType.Oracle:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 AND TodoEmps LIKE '%" + WebUser.No + ",%' AND  ROWNUM <= 20 ORDER BY SendDT DESC ";
                    break;
                default:
                    sql = "SELECT SendDT,Sender,WFState,TodoEmps,FlowName,NodeName,WorkID,Title,StarterName,Starter FROM WF_GenerWorkFlow WHERE WFState >1 AND TodoEmps LIKE '%" + WebUser.No + ",%' ORDER BY SendDT DESC  LIMIT 20";
                    break;
            }
            DataTable dt = DBAccess.RunSQLReturnTable(sql);
            return Tools.Json.ToJson(dt);
        }
        #endregion 流程动态组件.

        #region 流程指标.
        public string Self_FlowZhiBiaoEmp()
        {
            return "";
        }
        public string Self_FlowZhiBiaoAdmin()
        {
            return "";
        }
        #endregion 流程指标

        #region 流程运行数据
        public string Self_FlowDataAdmin()
        {
            return "";
        }
        public string Self_FlowDataEmp()
        {
            return "";
        }
        #endregion 流程运行数据

    }
}
